package  
{
	import org.flixel.*;
	
	/**
	 * ...
	 * @author le-ray_y
	 */
	public class Menu extends FlxState 
	{
		// Background
		[Embed(source = '../../Assets/splashscreen.jpg')]
		private var _backGroundClass:Class;
		private var _backGround:FlxSprite;
		
		private var _text:FlxText;
		
		override public function create():void
		{
			// Background
			_backGround = new FlxSprite(0, 0, _backGroundClass);
			this.add(_backGround);
			
			// Text: Title
			_text = new FlxText(200, FlxG.height / 2 - 16, FlxG.width, "Leave My Dungeon Alone !");
			_text.size = 16;
			_text.alignment = "center";
			add(_text);
			
			// Text: Click to start
			_text = new FlxText(0, FlxG.height - 32, FlxG.width, "click to start");
			_text.size = 16;
			_text.alignment = "center";
			add(_text);
			
			// Text: Credits 1
			_text = new FlxText(0, FlxG.height - 16, FlxG.width, "Graphics : Kalumis");
			_text.size = 10;
			_text.alignment = "left";
			add(_text);
			
			// Text: Credits 2
			_text = new FlxText(0, FlxG.height - 16, FlxG.width, "Dev : Daylz");
			_text.size = 10;
			_text.alignment = "right";
			add(_text);
			
			// Flixel Mouse Cursor
			FlxG.mouse.show();
		}
		
		override public function update():void
		{
			super.update();
			
			// Game Launch
			if (FlxG.mouse.justPressed())
			{
				FlxG.switchState(new Game());
			}
		}
	}

}